<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>barhomogenize</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 30/11/2005</div>
    <p>
      <b>barhomogenize</b> - homogenize all the bars included in the current working axes</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>barhomogenize()</tt>
      </dd>
      <dd>
        <tt>barhomogenize([h[,'style'[,'width']]])</tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>h</b>
        </tt>: an axes handle, (default: h=gca() ).</li>
      <li>
        <tt>
          <b>style</b>
        </tt>a string, 'grouped' or 'stacked' (default: 'grouped').</li>
      <li>
        <tt>
          <b>width</b>
        </tt>: (optional), a real scalar, defines the width (a percentage of
					the available room) for the bar (default: 0.8).</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>If there are several bar calls, the <tt>
        <b>barhomogenize</b>
      </tt> function
		allows to homogenize the width and style of all bars (i.e which has the
		<tt>
        <b>polyline_style</b>
      </tt> type 6) included in the current working axes.
		These bars must have the same x data.</p>
    <p>
      <tt>
        <b>barhomogenize( ) :</b>
      </tt> takes the default values, h=gca(),
		width=0.8, style='grouped'. <tt>
        <b></b>
      </tt>
    </p>
    <p>
      <tt>
        <b>barhomogenize(h,...) :</b>
      </tt> defines the current axes where the
		drawing is performed.</p>
    <p>
      <tt>
        <b>barhomogenize(...,width,...) :</b>
      </tt> defines the width of the
		bar(s) in percentage (generally: 0&lt;width&lt;=1).</p>
    <p>
      <tt>
        <b>barhomogenize(...,style,...) :</b>
      </tt> defines how the bars are
		drawn. The 'grouped' option allows to center the M polylines versus each
		components of x, and the 'stacked' option allows to stack them.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>
// First example: creation of 1 yellow bar (i.e 1 polyline with polyline_style=6) and 3 bars (i.e 3 polylines with polyline_style=6) 
subplot(2,3,1)
xtitle('ex1: creation of 1 yellow bar and 3 bars ')
x=1:3; y1=1:3; y2=[4 3 5;6 7 8;9 10 11];
bar(x,y1,'yellow');bar(x,y2);
// grouped homogenisation of these 4 bars
subplot(2,3,2) 
xtitle('grouped homogenisation')
x=1:3; y1=1:3; y2=[4 3 5;6 7 8;9 10 11];
bar(x,y1,'yellow');bar(x,y2);
barhomogenize();
// stacked homogenisation of thes 4 bars
subplot(2,3,3)
xtitle('stacked homogenisation')
x=1:3; y1=1:3; y2=[4 3 5;6 7 8;9 10 11];
bar(x,y1,'yellow');bar(x,y2);
barhomogenize('stacked',1);

// Second example : creation of 1 red bar (i.e 1 polyline with polyline_style=6) and 2 polylines with type=1 (calling plot function)
subplot(2,3,4)
xtitle('ex2: creation of 1 bar and 2 polylines')
x=1:10; y=sin(x)/2;
bar(x,y,'red')
x1=1:10;y1=[sin(x);cos(x)]
plot(x1,y1)
// modify the polyline_style type of the second polyline from plot (this polyline becomes a bar)
subplot(2,3,5)
xtitle('transformation of the second polyline to bar')
x=1:10; y=sin(x)/2;
bar(x,y,'red')
x1=1:10;y1=[sin(x);cos(x)]
plot(x1,y1)
e=gce(); e2=e.children(2); e2.polyline_style=6;
// homogenisation of the first bar (from bar function) and second bar (from the modification). 
subplot(2,3,6)
xtitle('grouped homogenisation')
x=1:10; y=sin(x)/2;
bar(x,y,'red')
x1=1:10;y1=[sin(x);cos(x)]
plot(x1,y1)
e=gce(); e2=e.children(2); e2.polyline_style=6;
barhomogenize();
// change the style and the width
//barhomogenize('stacked',0.5);
//barhomogenize('stacked',1);
</pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="bar.htm">
        <tt>
          <b>bar</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="polyline_properties.htm">
        <tt>
          <b>polyline_properties</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Author</font>
    </h3>
    <p>Farid Belacehne</p>
  </body>
</html>
